<!-- Plugin fotos -->
<!-- GENEALOGIA PLUGIN -->
<link rel="stylesheet" href="<?=base_url()?>resources/css/jquery.jOrgChart.css"/>
<link rel="stylesheet" href="<?=base_url()?>resources/css/font-awesome.min.css">
<link rel="stylesheet" href="<?=base_url()?>resources/source/jquery.fancybox.css" />
</head>
<body>

<? $this->load->view('core/core_menu') ?>


<section id="midTitle">
	<div class="top-guia auto_margin">
	<div class="guia"><a href="<?=base_url()?>index.php/core/main">INICIO</a>   /  EQUINOS </div>
	<h2><?= $equino['nombre'] ?></h2>
	</div>
</section>


<section id="Main">

<div class="areaDescript auto_margin" style="overflow: hidden;">
		<div class="row">
			<div class="col-sm-8" style="border-right: 1px solid #DDD;">
				<div class="gall-contt">
				<!-- Nav tabs -->
				<ul class="nav nav-tabs">
				  <li class="active"><a href="#galeria" data-toggle="tab">Galería</a></li>
				  <li><a href="#video" data-toggle="tab">Video</a></li>
				</ul>
				
				<!-- Tab panes -->
				<div class="tab-content">
				  <div class="tab-pane active" id="galeria">
				  <div class="contt-galeria">
                  
                  <div style="width:610px; height:458px"  class="zoomWrapper"><img style="border: 1px solid rgb(232, 232, 230); position: absolute;" id="zoom_03" src="<?=base_url()?>uploads/equinos/b<?= $equino['imagen'] ?>" data-zoom-image="<?=base_url()?>uploads/equinos/<?= $equino['imagen'] ?>" ></div>

<div id="gallery_01" style="width: 610px;">
 
<a href="#" class="elevatezoom-gallery active" data-update="" data-image="<?=base_url()?>uploads/equinos/b<?= $equino['imagen'] ?>" data-zoom-image="<?=base_url()?>uploads/equinos/<?= $equino['imagen'] ?>">
<img src="<?=base_url()?>uploads/equinos/s<?= $equino['imagen'] ?>"></a>

<? if(!empty( $equino['imagen2'] )){ ?> 
<a href="#" class="elevatezoom-gallery active" data-update="" data-image="<?=base_url()?>uploads/equinos/b<?= $equino['imagen2'] ?>" data-zoom-image="<?=base_url()?>uploads/equinos/<?= $equino['imagen2'] ?>">
<img src="<?=base_url()?>uploads/equinos/s<?= $equino['imagen2'] ?>"></a>
<? } ?>

<? if(!empty( $equino['imagen3'] )){ ?> 
<a href="#" class="elevatezoom-gallery" data-image="<?=base_url()?>uploads/equinos/b<?= $equino['imagen3'] ?>" data-zoom-image="<?=base_url()?>uploads/equinos/<?= $equino['imagen3'] ?>"><img src="<?=base_url()?>uploads/equinos/s<?= $equino['imagen3'] ?>" ></a>
<? } ?>

<? if(!empty( $equino['imagen4'] )){ ?> 
<a href="tester" class="elevatezoom-gallery" data-image="<?=base_url()?>uploads/equinos/b<?= $equino['imagen4'] ?>" data-zoom-image="<?=base_url()?>uploads/equinos/<?= $equino['imagen4'] ?>">
     <img src="<?=base_url()?>uploads/equinos/s<?= $equino['imagen4'] ?>" >
</a>
<? } ?>

<? if(!empty( $equino['imagen5'] )){ ?> 
<a href="tester" class="elevatezoom-gallery" data-image="<?=base_url()?>uploads/equinos/b<?= $equino['imagen5'] ?>" data-zoom-image="<?=base_url()?>uploads/equinos/<?= $equino['imagen5'] ?>"><img src="<?=base_url()?>uploads/equinos/s<?= $equino['imagen5'] ?>" ></a>
<? } ?>
    
</div>

				  </div>
				  </div>
				 <? if(!empty($video))
					{ ?>
				  <div class="tab-pane" id="video">
				  	<iframe width="640" height="360" src="https://www.youtube.com/embed/<?= $video ?>" frameborder="0" allowfullscreen></iframe>
					
				  </div>
                 <? } ?>   

				</div>
				</div>
			</div>
			<div class="col-sm-4">
				
                <div class="righBlq">
                    <span class="tt1">Precio:</span>
                    <span class="price">$<?= number_format($equino['precio'], 0, ',', '.') ?></span>
				</div>
				
				<div class="vtitle">VENDEDOR</div>
                <div class="righBlq">
                    <div class="row">
                    
                     <? if(!empty($vendedor['movil']))
                        { ?>
                        <div class="col-sm-6">
                        <span class="tt3">CELULAR</span>
                        <span class="tt4"><?= $vendedor['movil'] ?></span>
                        </div>
                     <? } ?>   
                                            
                        <div class="col-sm-6">
                        <span class="tt3">CIUDAD</span>
                        <span class="tt4">Armenia</span>
                        </div>
                        
                        <div class="col-sm-6">
                        <span class="tt3">DEPARTAMENTO</span>
                        <span class="tt4">Quindío</span>
                        </div>
                        
                    </div>
                </div>

				<div class="vtitle">Contacte al vendedor</div>
                <div class="righBlq">
                    <div class="row">
                        <div class="col-sm-12">
                        <input type="hidden" value="<?= $vendedor['email'] ?>">
                    	<input type="email" class="form-control" placeholder="Ingrese su email:" name="equi[nombre]" required>
                        <br>
                        <textarea class="form-control" rows="3" name="equi[descripcion]" placeholder="Su consulta:" ></textarea>
                        <br>
                        <button type="submit" class="btn btn-default btn-lg active">Enviar consulta</button>
                        </div>
                    </div>
                </div>
            
            </div>
				
				<div class="col-sm-12" style="border-top: 1px solid #DDD;">
				 <h3 class="cTitle">DATOS DEL <strong>EQUINO</strong></h3>
				 <div class="dataEquino">
                 
				 	<div class="row">
				 		
					 <? if(!empty($equino['nombre']))
                        { ?>
                        <div class="col-sm-6">
				 		   <div class="eqtag">
				 			<label>NOMBRE</label>
				 			 <span><?= $equino['nombre'] ?> </span>
				 			</div>
				 		</div>
                     <? } ?>   
				 		
					 <? if(!empty($equino['referencia_genetica']))
                        { ?>
                        <div class="col-sm-6">
				 		   <div class="eqtag">
				 			<label>REFERENCIA GENÉTICA</label>
				 			 <span><?= $equino['referencia_genetica'] ?> </span>
				 			</div>
				 		</div>
                     <? } ?>   
				 		
					 <? if(!empty($equino['padre']))
                        { ?>
                        <div class="col-sm-6">
				 		   <div class="eqtag">
				 			<label>PADRE</label>
				 			 <span><?= $equino['padre'] ?> </span>
				 			</div>
				 		</div>
                     <? } ?>   
				 		
					 <? if(!empty($equino['madre']))
                        { ?>
                        <div class="col-sm-6">
				 		   <div class="eqtag">
				 			<label>MADRE</label>
				 			 <span><?= $equino['madre'] ?> </span>
				 			</div>
				 		</div>
                     <? } ?>   
				 		
					 <? if(!empty($equino['raza']))
                        { ?>
				 		<div class="col-sm-3">
				 		   <div class="eqtag">
				 			<label>RAZA</label>
				 			 <span><?= $equino['raza'] ?></span>
				 			</div>
				 		</div>
                     <? } ?>   
				 		
					 <? if(!empty($equino['andar']))
                        { ?>
			 			<div class="col-sm-3">
				 		   <div class="eqtag">
				 			<label>ANDAR</label>
				 			 <span><?= $equino['andar'] ?></span>
				 			</div>
				 		</div>
                     <? } ?>   
				 		
					 <? if(!empty($equino['alzada']))
                        { ?>
				 		<div class="col-sm-2">
				 		   <div class="eqtag">
				 			<label>ALZADA</label>
				 			 <span><?= $equino['alzada'] ?> Mts</span>
				 			</div>
				 		</div>
                     <? } ?>   
				 	
					 <? if(!empty($equino['edad']))
                        { ?>
				 		<div class="col-sm-2">
				 		   <div class="eqtag">
				 			<label>EDAD</label>
				 			 <span><?= $equino['edad'] ?> Años</span>
				 			</div>
				 		</div>
                     <? } ?>   
				 		
					 <? if(!empty($equino['color']))
                        { ?>
				 		<div class="col-sm-1">
				 		   <div class="eqtag">
				 			<label>COLOR</label>
				 			 <span><?= $equino['color'] ?></span>
				 			</div>
				 		</div>
                     <? } ?>   
				 		
					 <? if(!empty($equino['sexo']))
                        { ?>
				 		<div class="col-sm-1">
				 		   <div class="eqtag">
				 			<label>SEXO</label>
				 			 <span><?= $equino['sexo'] ?></span>
				 			</div>
				 		</div>
                     <? } ?>   
				 		
					 <? if(!empty($equino['n_microchip']))
                        { ?>
				 		<div class="col-sm-3">
				 		   <div class="eqtag">
				 			<label>NO. DE MICROCHIP</label>
				 			 <span><?= $equino['n_microchip'] ?></span>
				 			</div>
				 		</div>
                     <? } ?>   

					 <? if(!empty($equino['n_registro']))
                        { ?>
				 		<div class="col-sm-3">
				 		   <div class="eqtag">
				 			<label>NO. DE REGISTRO</label>
				 			 <span><?= $equino['n_registro'] ?></span>
				 			</div>
				 		</div>
                     <? } ?>   
				 	
				 		<div class="col-sm-3">
				 		   <div class="eqtag">
				 			<label>LUGAR DE NACIMIENTO</label>
				 			 <span>Armenia (Quindío)</span>
				 			</div>
				 		</div>
				 	
				 		<div class="col-sm-3">
				 		   <div class="eqtag">
				 			<label>UBICACIÓN ACTUAL</label>
				 			 <span>Armenia (Quindío)</span>
				 			</div>
				 		</div>

				 	</div>
				 </div>
				 <div class="clearfix"></div>
				  <h3 class="cTitle">INFORMACIÓN <strong>GENERAL</strong></h3>
				  <div class="areaDestt">
				  <p><?= $equino['descripcion'] ?></p>
				  </div>
				  
				  <h3 class="cTitle">GENEALOGIA | <button type="button" class="btn btn-primary btn-xs" id="show_hide"> <i class="fa fa-arrow-down"></i> MOSTRAR</button></h3>
			 	  
                  <div class="areaDestt" id="acordeon" >
                  
				 	<ul id="org" style="display:none">
				 	<li class="">
				 	       <div class="orgTd"><?= $equino['a1'] ?></div>
				 	       <ul>
				 	        <li>
				 	        	 <div class="orgTd"><?= $equino['a1b1'] ?></div>
				 	           <ul>
				 	             <li class="">
				 	             	<div class="orgTd"><?= $equino['a1b1c1'] ?></div>
				 	               <ul>
				 	                 <li><div class="orgTd"><?= $equino['a1b1c1d1'] ?></div></li>
				 	                 <li><div class="orgTd"><?= $equino['a1b1c1d2'] ?></div></li>
				 	                </ul>
				 	         	</li>
					 	         <li><div class="orgTd"><?= $equino['a1b1c2'] ?></div>
						 	         <ul>
							 	         <li><div class="orgTd"><?= $equino['a1b1c2d3'] ?></div></li>
							 	         <li><div class="orgTd"><?= $equino['a1b1c2d4'] ?></div></li>
						 	         </ul>
					 	         </li>
				 	        	</ul>
				 	        </li>
				 	         
				 	         
				 	       <li>
				 	       	  <div class="orgTd"><?= $equino['a1b2'] ?></div>
				 	         <ul>
				 	            <li class="">
				 	            	<div class="orgTd"><?= $equino['a1b2c3'] ?></div>
					 	           <ul>
					 	             <li><div class="orgTd"><?= $equino['a1b2c3d5'] ?></div></li>
					 	             <li><div class="orgTd"><?= $equino['a1b2c3d6'] ?></div></li>
					 	           </ul>
				 	         	</li>
				 	         <li class="">
				 	         	<div class="orgTd"><?= $equino['a1b2c4'] ?></div>
					 	          <ul>
					 	           <li>
					 	           	<div class="orgTd"><?= $equino['a1b2c4d7'] ?></div>
					 	           <ul>
					 	         </ul>
					 	         </li>
					 	         <li>
					 	         	<div class="orgTd"><?= $equino['a1b2c4d8'] ?></div>
					 	         </li>
					 	         </ul>
				 	         </li>
				 	         </ul>
				 	         </li>
				 	       </ul>
				 	     </li>
				 	</ul>
				 	
				 	    <div id="chart" class="orgChart"></div>
                    
				 </div>

				</div>
			</div>
		</div>	

</section>

	<section class="areaComments auto_margin">
	 <span class="tt">PREGUNTAS AL VENDEDOR</span>
	<div class="commForm">
    <?php
				$attributes = array('name'     => 'formulario',
					'id' => 'form-validate',
   					'method'   => 'post');

		echo form_open('/equino/preguntas',$attributes);
		echo form_hidden('id_equino',$equino['id_equino']);
				?>
		<textarea class="inp-text" name="pregunta" rows="2" placeholder="Escribe tu pregunta"></textarea>
		<input type="submit" name="" value="PREGUNTAR" class="bttSend"  />
	</div>
	 
	 
        <?php 
		foreach($preguntas as $row){
		?>
        <ul>
	 	<li>
	 	<div class="item">
	 		<div class="ddt1"><strong>PREGUNTA</strong> / <span class="date"><?=$row['fecha']?></span></div>
	 		<?=$row['pregunta']?>	 	</div>
         <?
		$respuestas = $this -> preguntas_model ->obtenerRespuestas($row['id_pregunta']);
		 foreach($respuestas as $row2){
			 
		 ?>
	 	 <ul>
	 	 	<li>
	 	 	<div class="item">
	 	 		<div class="ddt1"><strong>RESPUESTA</strong> / <span class="date"><?=$row2['fecha']?></span></div>
	 	 		<?=$row2['respuesta']?>
	 	 	</div>
	 	 	</li>
	 	 	
	 	 </ul>
         <? } ?>
	 	</li>
	 	
	 </ul>
	 <?php 
		}
		?>
	</section>




<section id="areaSlog">
	<div class="textMiddle auto_margin">
		<span class="tt1">Facilidad, comodidad y agilidad</span>
		<span class="tt2">en la venta de su caballo</span>
		<a href="" class="vButton">VENDA SU EQUINO</a>
	</div>
</section>

<section id="areaBanners" class="auto_margin">
	<div class="row">
		<div class="col-sm-4"><img src="http://placehold.it/318x140"></div>
		<div class="col-sm-4"><img src="http://placehold.it/318x140"></div>
		<div class="col-sm-4"><img src="http://placehold.it/318x140"></div>
	</div>
</section>

<!-- Include js plugin fotos -->

<!-- GENEALOGIA PLUGIN -->
<script type="text/javascript" src="<?=base_url()?>resources/js/jquery.jOrgChart.js"></script>

<script src='<?=base_url()?>resources/js/jquery.elevatezoom.js'></script>
<script src="<?=base_url()?>resources/source/jquery.fancybox.js" type="text/javascript"></script>
<script>
jQuery(document).ready(function() {
    $("#org").jOrgChart({
        chartElement : '#chart',
        dragAndDrop  : false
    });
	
	$("#acordeon").hide();
	
	$('#show_hide').click(function(){
    	$("#acordeon").slideToggle();
    });


$("#zoom_03").elevateZoom({gallery:'gallery_01', cursor: 'pointer', galleryActiveClass: "active", imageCrossfade: true}); 

$("#zoom_03").bind("click", function(e) {  
  var ez =   $('#zoom_03').data('elevateZoom');
  ez.closeAll(); //NEW: This function force hides the lens, tint and window	
	$.fancybox(ez.getGalleryList());
  return false;
}); 

});

	
</script>
